package com.eling.elcms.community.dao.hibernate;

import com.eling.elcms.community.dao.ICommunityDao;
import com.eling.elcms.community.model.Community;
import com.eling.elcms.core.dao.hibernate.GenericDaoHibernate;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@Repository
public class CommunityDaoHibernate extends GenericDaoHibernate<Community, Long> implements ICommunityDao {

    public CommunityDaoHibernate() {
        super(Community.class);
    }
    
    public Community add(@RequestBody Community user) {
    	return this.save(user);
    }
    
    public void delete(@RequestBody Community user) {
    	this.remove(user);
    }
    
    public Community update(@RequestBody Community user) {
    	return this.save(user);
    }
    
    public List<Community> queryAll(@RequestBody Community user) {
    	return this.getAll();
    }

    

}
